//
//  TestCard.swift
//  SwiftUIStacks
//
//  Created by 李煜 on 2024/7/31.
//

import SwiftUI

struct TestCard: View {
  var body: some View {
    ZStack {
      OneCard(title: "BASIC", bgColor: .purple)
        .offset(y: 180)
      OneCard(title: "PRO", bgColor: .orange)
        .scaleEffect(0.9)
      
      OneCard(title: "Team", bgColor: .gray)
        .offset(y: -180)
        .scaleEffect(0.8)
    }
//    .background(.cyan)
  }
}

struct OneCard: View {
  var title: String
  var bgColor: Color
  var body: some View {
    VStack {
      Text(title)
        .font(.system(.title, design: .rounded))
        .fontWeight(.black)
    }
    .frame(minWidth: 0, maxWidth: .infinity, minHeight: 220)
    .padding()
    .background(bgColor)
    .foregroundStyle(.white)
    .cornerRadius(16)
    .padding()
  }
}

#Preview {
  TestCard()
}
